package cn.hgy.domain.activity.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum DiscountTypeEnum {

    BASE(0, "基础优惠"),
    TAG(1, "人群标签优惠");


    private Integer code;
    private String info;

    public static DiscountTypeEnum get(Integer code) {
        return switch (code) {
            case 0 -> BASE;
            case 1 -> TAG;
            default -> throw new IllegalArgumentException("未知的优惠类型: " + code);
        };
    }
}
